package com.kongjs.application.tenant;

import jakarta.annotation.Resource;
import org.redisson.api.RTopic;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class TenantRoleHierarchyMessage implements InitializingBean {
    @Resource
    private RedissonClient redissonClient;
    @Resource
    private ApplicationContext applicationContext;

    public void publish(String tenantId) {
        RTopic topic = redissonClient.getTopic("RoleHierarchy");
        long published = topic.publish(tenantId);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
    }
}
